Skip to content

Conversation

khwilliamson
Copy link
Contributor

Place the trivial case first; this also removes complementing the conditional.

These make it easier to read

  • This set of changes does not require a perldelta entry.

Place the trivial case first; this also removes complementing the
conditional.

These make it easier to read
@khwilliamson khwilliamson changed the title locale.c: Reverse conditional locale.c: Reverse order of conditionals Aug 15, 2025
if (is_locale_utf8(locale)) {
locale_utf8ness = LOCALE_IS_UTF8;
}
else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe drop the curlys for less whitespace/more code on 1 screen for the if()?

Its upto you, I dont have much of an opinion either way.

LOCALE_IS_UTF8 is a const from an enum according to grep, not a STMT_START { thing or a complicated long expression so I dont see a real or paranoia precedence/syntax error hazard here for inserting {} for a 1 liner.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been burned too many times by adding, say, a debugging statement that broke things because I forgot to add braces at the same time.

@khwilliamson khwilliamson merged commit b70be8d into Perl:blead Aug 16, 2025
33 checks passed
@khwilliamson khwilliamson deleted the strftime branch September 4, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants